<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>01</li>
        <li>02</li>
        <li>03</li>
        <li>04</li>
    </ul>
</body>
<script>
function Getele(ele){
    this.eles=document.querySelectorAll(ele)
}
function $(ele){
    return new Getele(ele)
}
Getele.prototype.each=function (fn){
    for(var i=0;i<this.eles.length;i++){
        var item=this.eles[i]
        var index=i
        var array=Array.prototype.slice.call(this.eles)
    
        fn(item,index,array)
    }
}

Getele.prototype.html=function(){
    if(arguments.length>0){
        con=arguments[0]
        this.each(function(item,index){
        item.innerHTML=con
    })
    }
    else{
        return this.eles[0].innerHTML
    }
    
}


console.log($("li").html())
</script>
</html>